#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.basic.websocket;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * Description: 无法补充
 *
 * @author wupanhua
 * @date 2019/8/6 15:28
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Configuration
public class WebSocketConfig implements WebSocketConfigurer {

    /**
     * Description:
     * <无法补充>
     * @author wupanhua
     * @date 14:02 2019/8/7
     * @param webSocketHandlerRegistry 1
     **/
    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry webSocketHandlerRegistry) {
        webSocketHandlerRegistry.addHandler(webSocketServer(), "/yk_api/websocketserver").setAllowedOriginPatterns("*");
    }

    /**
     * Description:
     * <无法补充>
     * @author wupanhua
     * @date 14:03 2019/8/7
     * @return org.springframework.web.socket.WebSocketHandler
     **/
    @Bean
    public WebSocketHandler webSocketServer() {
        return new WebSocketServer();
    }
}
